import { useI18n } from '@/locales/useI18n'
import { message } from 'ant-design-vue'

const { t } = useI18n('system')

export async function useInnerForm(validateFormFn: PromiseFn) {
  return validateFormFn().catch((err: any) => {
    message.warning(t('form.warning'))
    return Promise.reject(err)
  })
}

export default useInnerForm